package petClinic;

import java.util.*;
import javax.persistence.*;

@Entity
@Table(name = "PETOWNER")
public class PetOwner extends Person{

	@OneToMany(mappedBy = "owner")
	private List<Pet> pets = new ArrayList<>();

	public List<Pet> getPets() {
		return pets;
	}

	public void setPets(List<Pet> pets) {
		this.pets = pets;
	}

	public PetOwner(String firstName, String lastName, String email,
			List<Pet> pets) {
		super(firstName, lastName, email);
		this.pets = pets;
	}

	public PetOwner(){

	}
	
	@Override
	public String toString() {
	
		return this.getFirstName() + ", " + this.getLastName() ;
	}
}
